<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 1. 提示用户输入用户名
      const username = prompt("Who's there?");
      if (username === "Admin") {
        //2. 提示用户输入密码
        const password = prompt("Password?");
        if (password === "123123") {
          // 密码正确
          console.log("wellcome");
        } else if (password === null) {
          // 用户按下取消按钮
          console.log("Canceled");
        } else {
          // 密码错误
          console.log("Wrong password");
        }
      } else if (username === null) {
        // 用户按下取消按钮
        console.log("Canceled");
      } else {
        console.log("I don't know you");
      }
    </script>
  </body>
</html>
